#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from functools import reduce

# sum
def add(x, y):
    return x + y

reduce(add, [1, 2, 3, 4, 5])

# prod
def prod(L):
    return reduce(prod_red, L)

def prod_red(x, y):
    return x * y

prod([1, 2, 3, 4, 5])
